<template>
  <view class="confirm-bg">
    <!-- 合同卡片 -->
    <view class="card contract-card">
      <view class="card-title">
        <image src="/static/contract.png" class="contract-icon" />
        <text class="contract-name">合同名称</text>
      </view>
      <view class="divider"></view>
      <!-- 甲方信息 -->
      <view class="party-info">
        <text class="party-label">甲方</text>
        <template v-if="isPartyA">
          <text class="party-name">姓名</text>
          <view class="party-detail">
            <text>13333333333</text>
            <text class="divider-dot">|</text>
            <text>512xxxxxxxxxxxxxxx</text>
          </view>
        </template>
        <template v-else>
          <text class="party-wait">待对方补充</text>
        </template>
      </view>
      <!-- 乙方信息 -->
      <view class="party-info party-b">
        <text class="party-label">乙方</text>
        <template v-if="!isPartyA">
          <text class="party-name">姓名</text>
          <view class="party-detail">
            <text>13333333333</text>
            <text class="divider-dot">|</text>
            <text>512xxxxxxxxxxxxxxx</text>
          </view>
        </template>
        <template v-else>
          <text class="party-wait">待对方补充</text>
        </template>
      </view>
    </view>

    <!-- 合同信息卡片 -->
    <view class="card info-card">
      <view class="info-title">合同信息</view>
      <view class="divider"></view>
      <view class="info-list">
        <view class="info-item" v-for="i in 3" :key="i">
          <text class="info-label">合同信息</text>
          <text class="info-value">xxxx</text>
        </view>
      </view>
    </view>

    <!-- 底部按钮 -->
    <view class="footer">
      <button class="preview-btn" type="primary" @click="goSuccess">预览合同</button>
    </view>
  </view>
</template>

<script setup>
import { ref } from 'vue'
// 默认甲方，可根据实际业务传参切换
const isPartyA = ref(true)
function goSuccess() {
  uni.navigateTo({ url: '/pages/detail/index' })
}
</script>

<style lang="scss" scoped>
.confirm-bg {
  background: #f4f4f4;
  min-height: 100vh;
  padding: 20rpx 0 120rpx 0;
}
.confirm-header {
  background: #f55a4e;
  height: 100rpx;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32rpx;
  border-bottom-left-radius: 24rpx;
  border-bottom-right-radius: 24rpx;
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  .header-title {
    color: #fff;
    font-size: 36rpx;
    font-weight: bold;
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 16rpx;
    .header-dot {
      width: 24rpx;
      height: 24rpx;
      background: #111;
      border-radius: 50%;
      border: 2rpx solid #fff;
    }
  }
}
.card {
  background: #fff;
  border-radius: 20rpx;
  box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04);
  margin: 0 24rpx 0 24rpx;
  padding: 32rpx 28rpx;
}
.contract-card {
  margin-top: 0;
  .card-title {
    display: flex;
    align-items: center;
    .contract-icon {
      width: 48rpx;
      height: 48rpx;
      margin-right: 16rpx;
    }
    .contract-name {
      color: #f55a4e;
      font-size: 32rpx;
      font-weight: bold;
    }
  }
  .divider {
    height: 2rpx;
    background: #f55a4e;
    margin: 24rpx 0;
    opacity: 0.2;
  }
  .party-info {
    display: flex;
    align-items: center;
    margin-bottom: 12rpx;
    .party-label {
      color: #f55a4e;
      font-weight: bold;
      margin-right: 12rpx;
    }
    .party-name {
      color: #222;
      font-weight: bold;
      margin-right: 16rpx;
    }
    .party-detail {
      color: #222;
      font-size: 26rpx;
      .divider-dot {
        margin: 0 8rpx;
        color: #bbb;
      }
    }
    &.party-b {
      .party-wait {
        color: #bbb;
        margin-left: 8rpx;
      }
    }
  }
}
.info-card {
  margin-top: 32rpx;
  .info-title {
    color: #222;
    font-size: 30rpx;
    font-weight: bold;
    margin-bottom: 12rpx;
  }
  .divider {
    height: 2rpx;
    background: #eee;
    margin-bottom: 16rpx;
  }
  .info-list {
    .info-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16rpx;
      .info-label {
        color: #888;
        font-size: 28rpx;
      }
      .info-value {
        color: #222;
        font-size: 28rpx;
        font-weight: bold;
      }
    }
  }
}
.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 32rpx;
  display: flex;
  justify-content: center;
  z-index: 10;
  .preview-btn {
    width: 90vw;
    height: 88rpx;
    background: #f55a4e;
    color: #fff;
    font-size: 32rpx;
    border-radius: 16rpx;
    font-weight: bold;
    box-shadow: 0 4rpx 16rpx rgba(245,90,78,0.12);
  }
}
</style> 